<html>
	<head>
	<script language="JavaScript">
	var india=new Array("bhopal","indore","sagar","bina");
	var USA = new Array("Newyork","california");
	function clearList()
	{
		var noOfOption = document.reg.city.length;
		for(var i=0;i<noOfOption;i++)
		{
			document.reg.city.remove(0);
		}
	}
	
	function populateCity()
	{
		clearList()
		var country;
		if(document.reg.country.value=='India')
			country=india;
		else
			country=USA;
		
		for(var i=0;i<country.length;i++)
		{
		 	var optn = document.createElement("OPTION");
			optn.text =country[i] ;
			optn.value = country[i];
			document.reg.city.options.add(optn);
		}
		if(document.reg.country.value=='country')
		{
			clearList();
			var optn = document.createElement("OPTION");
			optn.text = 'Select City';
			optn.value ='city';
			document.reg.city.options.add(optn);
		}
			
	}	
	
	</script>
	</head>
	
	<BODY>
	<FORM name='reg'>
	<SELECT NAME="country" onChange='populateCity()'>
	<Option value="country" >Select Country</option>	
	<Option value="India" >India</option>
	<Option value="USA" >USA</option>
	</SELECT>
	<SELECT NAME="city">
	<Option value="" >City Name</option>
	</SELECT>
	</FORM>
	</BODY>
</html>